org.eclipse.vtp.framework.interactions.voice.vxml
Class Variable

java.lang.Object
  extended by org.eclipse.vtp.framework.interactions.core.support.Widget
      extended by org.eclipse.vtp.framework.interactions.voice.vxml.Variable
All Implemented Interfaces:
VXMLConstants

public class Variable
extends Widget
implements VXMLConstants

The Variable class represents the <var> VXML element. Variables hold temporary values during the processing of a VXML document. When declared, a variable can optionally be set to an initial value. Some platforms offer predefined variables that do not need declared with this element.

Version:
2.0
Author:
Trip Gilman, Lonnie Pryor

Field Summary
protected  java.lang.String initialValue
          The initial value of this variable
 
Fields inherited from interface org.eclipse.vtp.framework.interactions.voice.vxml.VXMLConstants
EMPTY, FILE_EXT_GSL, FILLED_MODE_ALL, FILLED_MODE_ANY, GRAMMAR_MODE_DTMF, GRAMMAR_MODE_VOICE, METHOD_GET, METHOD_POST, MIME_TYPE_GSL, MIME_TYPE_SRGS, NAME_APPLICATION, NAME_ASSIGN, NAME_AUDIO, NAME_BARGEIN, NAME_BEEP, NAME_BLOCK, NAME_BRIDGE, NAME_CATCH, NAME_CHOICE, NAME_COMPLETETIMEOUT, NAME_COND, NAME_CONFIDENCELEVEL, NAME_COUNT, NAME_DEST, NAME_DISCONNECT, NAME_DTMF, NAME_DTMFTERM, NAME_ELSE, NAME_ELSEIF, NAME_ENCTYPE, NAME_ENUMERATE, NAME_ERROR, NAME_EVENT, NAME_EVENTEXPR, NAME_EXIT, NAME_EXPR, NAME_FIELD, NAME_FILLED, NAME_FINALSILENCE, NAME_FORM, NAME_GOTO, NAME_GRAMMAR, NAME_ID, NAME_IF, NAME_INCOMPLETETIMEOUT, NAME_INPUTMODES, NAME_INTERDIGITTIMEOUT, NAME_ITEM, NAME_MAXNBEST, NAME_MAXSPEECHTIMEOUT, NAME_MAXTIME, NAME_MENU, NAME_METHOD, NAME_MODE, NAME_NAME, NAME_NAMELIST, NAME_NEXT, NAME_NOINPUT, NAME_NOMATCH, NAME_ONE_OF, NAME_OPTION, NAME_PARAM, NAME_PROMPT, NAME_PROPERTY, NAME_RECORD, NAME_REPEAT, NAME_REPROMPT, NAME_RETURN, NAME_ROOT, NAME_RULE, NAME_SCOPE, NAME_SCRIPT, NAME_SENSITIVITY, NAME_SPEEDVSACCURACY, NAME_SRC, NAME_SUBDIALOG, NAME_SUBMIT, NAME_TERMCHAR, NAME_TERMTIMEOUT, NAME_THROW, NAME_TIMEOUT, NAME_TRANSFER, NAME_TYPE, NAME_VALUE, NAME_VAR, NAME_VERSION, NAME_VXML, NAMESPACE_URI_VXML, QNAME_XML_LANG, SCOPE_DIALOG, SCOPE_DOCUMENT, TYPE_CDATA, VERSION_2_0
 
Constructor Summary
Variable(java.lang.String name)
          Creates a new instance of Variable with the specified name and no initial value.
Variable(java.lang.String name, java.lang.String initialValue)
          Creates a new instance of Variable with the specified name and initial value.
 
Method Summary
 java.lang.String getInitialValue()
          Returns the initial value of this variable.
 java.lang.String getName()
          Returns the name of this variable.
 void setInitialValue(java.lang.String initialValue)
          Sets the initial value of the variable.
 void setName(java.lang.String name)
          Sets the name of this variable.
protected  void writeAttributes(org.xml.sax.helpers.AttributesImpl attributes)
          Write the attribute members of this variable to the supplied set.
 void writeWidget(org.xml.sax.ContentHandler outputHandler)
          Writes the content of this widget to an XML content handler.
 
Methods inherited from class org.eclipse.vtp.framework.interactions.core.support.Widget
toString, writeAttribute, writeChildren, writeChildren, writeWidget, writeWidget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

initialValue

protected java.lang.String initialValue
The initial value of this variable

Constructor Detail

Variable

public Variable(java.lang.String name)
         throws java.lang.IllegalArgumentException,
                java.lang.NullPointerException
Creates a new instance of Variable with the specified name and no initial value. Throws an IllegalArgumentException if the name argument is null or is an empty string.

Parameters:
name - The name of this variable.
Throws:
java.lang.IllegalArgumentException - If the supplied name is empty.
java.lang.NullPointerException - If the supplied name is null.

Variable

public Variable(java.lang.String name,
                java.lang.String initialValue)
         throws java.lang.IllegalArgumentException,
                java.lang.NullPointerException
Creates a new instance of Variable with the specified name and initial value. Throws an IllegalArgumentException if the name argument is null or is an empty string.

Parameters:
name - The name of this variable.
initialValue - The initial value of this variable.
Throws:
java.lang.IllegalArgumentException - If the supplied name is empty.
java.lang.NullPointerException - If the supplied name is null.
Method Detail

getName

public java.lang.String getName()
Returns the name of this variable.

Returns:
The name of this variable.

getInitialValue

public java.lang.String getInitialValue()
Returns the initial value of this variable.

Returns:
The initial value of this variable.

setName

public void setName(java.lang.String name)
             throws java.lang.IllegalArgumentException,
                    java.lang.NullPointerException
Sets the name of this variable.

Parameters:
name - The name of this variable.
Throws:
java.lang.IllegalArgumentException - If the supplied name is empty.
java.lang.NullPointerException - If the supplied name is null.

setInitialValue

public void setInitialValue(java.lang.String initialValue)
Sets the initial value of the variable.

Parameters:
initialValue - The new initial value of the variable

writeWidget

public void writeWidget(org.xml.sax.ContentHandler outputHandler)
                 throws java.lang.NullPointerException,
                        org.xml.sax.SAXException
Description copied from class: Widget
Writes the content of this widget to an XML content handler.

Specified by:
writeWidget in class Widget
Parameters:
outputHandler - The handler to write this widget to.
Throws:
java.lang.NullPointerException - If the supplied content handler is null.
org.xml.sax.SAXException - If the writing of this widget fails.

writeAttributes

protected void writeAttributes(org.xml.sax.helpers.AttributesImpl attributes)
Write the attribute members of this variable to the supplied set.

Parameters:
attributes - The attribute set to write to.
Throws:
java.lang.NullPointerException - If the supplied attribute set is null.